<template>

	<view class="flex-col page">
		<view class="flex-col flex-1 group_3">
			<view class="flex-col">
				<view class="flex-col list">
					<view class="flex-col mt-8 section list-item">
						<view class="flex-row justify-between items-center group_4" @click="itemtab('9')">
							<text class="font_2">用户协议</text>
							<image class="image_5" src="/static/icon/right.png" />
						</view>
						<view class="flex-row justify-between items-center group_5" @click="itemtab('10')">
							<text class="font_2 text_5">隐私协议</text>
							<image class="image_5 image_6" src="/static/icon/right.png" />
						</view>
						<view class="flex-row justify-between items-center group_6">
							<text class="font_2 text_6">当前版本</text>
							<text class="font_3 text_7">1.0</text>
						</view>
					</view>




					<view class="flex-col mt-8 section list-item">
						<view class="flex-row justify-between items-center group_6">
							<text class="font_2 text_6">客服电话</text>
							<text class="font_3 text_7">{{myData.mobile }}</text>
						</view>
						<view class="flex-row justify-between items-center group_6">
							<text class="font_2 text_6">微信</text>
							<text class="font_3 text_7">{{myData.wx}}</text>
						</view>
						<view class="flex-row justify-between items-center group_6" @click="itemtab('11')">
							<text class="font_2 text_6">商务合作</text>
							<text class="font_3 text_7">{{myData.email}}</text>
						</view>

						<view class="flex-row justify-between items-center group_4" @click="itemtab('12')">
							<text class="font_2">营业执照</text>
							<image class="image_5" src="/static/icon/right.png" />
						</view>
						<!-- <view class="flex-row justify-between items-center group_5">
							<text class="font_2 text_5">注销账号</text>
							<image class="image_5 image_6" src="/static/icon/right.png" />
						</view> -->
					</view>
				</view>
				<view class="flex-col justify-start items-center button text-wrapper" v-show="type" @click="exit">
					<text class="font_2 text_13">退出登录</text>
				</view>
			</view>
			<view class="section_3 mt-137"></view>
		</view>
	</view>




</template>

<script>
	import {
		Logout
	} from '@/utils/user.js'

	export default {
		data() {
			return {
				items: [null, null],
				type: false,
				myData: {}
			}
		},
		onLoad() {


			this.myData = uni.getStorageSync('system');

			// 获取存储的数据
			const loginData = uni.getStorageSync('LoginData');

			// 判断是否有数据并设置 type 的值
		 
		 
			if (loginData) {
				this.type = true;
			} else {
				this.type = false;
			}
 

		},
		methods: {

			itemtab(i) {

				uni.navigateTo({
					url: '/pages/miscellaneous/miscellaneous?id=' + i
				})

			},



			exit() {

				Logout().then(res => {
					console.log(res)


					if (res.data.data.status == 1) {


						uni.showToast({
							title: '成功退出登录',
							icon: 'none',
							duration: 2000
						})

						uni.clearStorage();

						// uni.removeStorageSync('LoginData');


						uni.navigateBack({
							delta: 1, // 返回页面数，这里返回上一页

						});

					} else {

						uni.showToast({
							title: '退出登录失败',
							icon: 'none',
							duration: 2000
						})

					}




				}).catch(error => {
					console.error('Logout 方法执行出错：', error);
				})
			}

		}
	}
</script>

<style>
	.mt-137 {
		margin-top: 274rpx;
	}

	.page {
		background-color: #f4f5f7;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_3 {
		overflow-y: auto;
	}

	.list {
		padding-bottom: 40rpx;
	}

	.section {
		padding: 10rpx 22rpx 0;
		background-color: #ffffff;
	}

	.list-item:first-child {
		margin-top: 0;
	}

	.group_4 {
		padding: 52rpx 4rpx 34rpx;
	}

	.font_2 {
		font-size: 36rpx;
		font-family: PingFang SC;
		line-height: 33.36rpx;
		color: #222222;
	}

	.image_5 {
		margin-right: 10rpx;
		width: 23rpx;
		height: 23rpx;
	}

	.group_5 {
		margin-top: 8rpx;
		padding: 44rpx 4rpx 42rpx;
		border-top: solid 1rpx #f4f5f7;
		border-bottom: solid 1rpx #f4f5f7;
	}

	.text_5 {
		line-height: 33.22rpx;
	}

	.image_6 {
		margin-right: 8rpx;
	}

	.group_6 {
		padding: 42rpx 0 42rpx 4rpx;
		border-bottom: solid 1rpx #f4f5f7;
	}

	.text_6 {
		line-height: 33.34rpx;
	}

	.font_3 {
		font-size: 36rpx;
		font-family: PingFang SC;
		line-height: 26.72rpx;
		color: #222222;
	}

	.text_7 {
		line-height: 26.36rpx;
	}

	.button {
		margin: 0 52rpx;
	}

	.text-wrapper {
		padding: 28rpx 0;
		background-color: #ff521c;
		border-radius: 8rpx;
	}

	.text_13 {
		color: #ffffff;
		line-height: 33.4rpx;
	}

	.section_3 {
		background-color: #f4f5f7;
		height: 68rpx;
	}
</style>